package com.example.personalblog.controller;

import com.example.personalblog.entity.Comment;
import com.example.personalblog.service.CommentService;
import com.example.personalblog.vo.ShowComment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class MessageController {

    @Autowired
    CommentService commentService;

    @GetMapping("/message")
    public String getMessage(Model model){
        List<ShowComment> messageList = commentService.findCommentByBlogId(0);
        model.addAttribute("messageList",messageList);
        return "message";
    }

}
